/*
	created time:2018/4/3
	author:Chason
	describe:
*/



class Basic {
	public constructor() {

	}
    
    //处理按钮点着缩小放开放大--参数为按钮实例
	public static touchScaleBtn(obj):void{
		obj.touchEnabled=true;
		obj.addEventListener(egret.TouchEvent.TOUCH_BEGIN,()=>{
			obj.scaleX=0.98;
			obj.scaleY=0.98;
		},obj);
		obj.addEventListener(egret.TouchEvent.TOUCH_END,()=>{
			obj.scaleX=1;
			obj.scaleY=1;
		},obj);
		obj.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE,()=>{
			obj.scaleX=1;
			obj.scaleY=1;
		},obj);
	}

	//本玩家卡牌初始化的Y值
	public static meCardInitY(stageHeight){
		return stageHeight-130;
	}
	//本玩家的按钮初始的Y值
	public static meBtnInitY(stageHeight){
		return stageHeight-250;
	}
	
	

	/*
		游戏桌子背景(图片资源有限)
	*/
	public static zhuoBackground(self,stageWidth,stageHeight){
		let zhuoBg=new egret.Bitmap(RES.getRes("screenGameBg_json.zhuo"));
		zhuoBg.y=stageHeight-430;
		zhuoBg.x=0;
		zhuoBg.width=stageWidth;
		self.addChild(zhuoBg);
		self.setChildIndex( zhuoBg,2 );	
	}




	
}